package com.scwatch.core.web;

import org.springframework.beans.CachedIntrospectionResults;
import org.springframework.web.util.IntrospectorCleanupListener;

import javax.servlet.ServletContextEvent;
import javax.servlet.annotation.WebListener;

/**
 * 使用IntrospectorCleanupListener 解决quartz引起的内存泄漏
 */
@WebListener
public class CleanupListener  extends IntrospectorCleanupListener{
    @Override
    public void contextInitialized(ServletContextEvent event) {
        System.out.println("---------------------初始化IntrospectorCleanupListener----------");
        CachedIntrospectionResults.acceptClassLoader(Thread.currentThread().getContextClassLoader());
    }
}
